package com.yunsc.product.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yunsc.common.serializer.TimestampToDateSerializer;
import com.yunsc.media.entity.YunscUploadFileEntity;
import com.yunsc.product.dto.GoodsSkuDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @version: 1.0
 * @Author: adan
 * @description: 商品详情VO
 * @date: 2024-04-14 22:18
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "商品详情VO")
@Data
public class GoodsDetailVO implements Serializable {

    @ApiModelProperty(value = "商品ID")
    private Integer goodsId;

    @ApiModelProperty(value = "商品名称")
    private String goodsName;

    @ApiModelProperty(value = "商品编码")
    private String goodsNo;

    @ApiModelProperty(value = "主图视频ID")
    private Integer videoId;

    @ApiModelProperty(value = "主图视频ID")
    private Integer videoCoverId;

    @ApiModelProperty(value = "商品卖点")
    private String sellingPoint;

    @ApiModelProperty(value = "商品规格(10单规格 20多规格)")
    private Integer specType;

    @ApiModelProperty(value = "商品价格(最低)")
    private String goodsPriceMin;

    @ApiModelProperty(value = "商品价格(最高)")
    private String goodsPriceMax;

    @ApiModelProperty(value = "划线价格(最低)")
    private String linePriceMin;

    @ApiModelProperty(value = "划线价格(最高)")
    private String linePriceMax;

    @ApiModelProperty(value = "库存总量(包含所有sku)")
    private Integer stockTotal;

    @ApiModelProperty(value = "库存计算方式(10下单减库存 20付款减库存)")
    private Integer deductStockType;

    @ApiModelProperty(value = "商品详情")
    private String content;

    @ApiModelProperty(value = "初始销量")
    private Integer salesInitial;

    @ApiModelProperty(value = "实际销量")
    private Integer salesActual;

    @ApiModelProperty(value = "配送模板ID")
    private Integer deliveryId;

    @ApiModelProperty(value = "是否开启积分赠送(1开启 0关闭)")
    private Integer isPointsGift;

    @ApiModelProperty(value = "是否允许使用积分抵扣(1允许 0不允许)")
    private Integer isPointsDiscount;

    @ApiModelProperty(value = "积分抵扣设置(0默认抵扣 1单独设置抵扣)")
    private Integer isAlonePointsDiscount;

    @ApiModelProperty(value = "单独设置积分抵扣的配置")
    private String pointsDiscountConfig;

    @ApiModelProperty(value = "是否开启会员折扣(1开启 0关闭)")
    private Integer isEnableGrade;

    @ApiModelProperty(value = "会员折扣设置(0默认等级折扣 1单独设置折扣)")
    private Integer isAloneGrade;

    @ApiModelProperty(value = "单独设置折扣的配置")
    private Map<String, Object> aloneGradeEquity;

    @ApiModelProperty(value = "商品状态(10上架 20下架)")
    private Integer status;

    @ApiModelProperty(value = "排序(数字越小越靠前)")
    private Integer sort;

    @ApiModelProperty(value = "是否删除")
    private Integer isDelete;

    @ApiModelProperty(value = "商城ID")
    private Integer storeId;

    @ApiModelProperty(value = "创建时间")
    @JsonSerialize(using = TimestampToDateSerializer.class)
    private Integer createTime;

    @ApiModelProperty(value = "更新时间")
    @JsonSerialize(using = TimestampToDateSerializer.class)
    private Integer updateTime;

    @ApiModelProperty(value = "商品主图片")
    private String goodsImage;

    @JsonProperty("categoryIds")
    @ApiModelProperty(value = "商品分类ID列表")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Integer> categoryIds;

    @JsonProperty("serviceIds")
    @ApiModelProperty(value = "商品服务id列表")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Integer> serviceIds;



    // @ApiModelProperty(value = "是否锁定规格")
    // private boolean isSpecLocked;
    //
    // public boolean getIsSpecLocked() {
    //     return isSpecLocked;
    // }
    //
    // public void setIsSpecLocked(boolean isSpecLocked) {
    //     this.isSpecLocked = isSpecLocked;
    // }

    /**
     * 商品类型(10实物商品)
     */
    private Integer goodsType;
    /**
     * 是否开启限购(0未开启 1已开启)
     */
    private Integer isRestrict;
    /**
     * 总限购数量(0为不限制)
     */
    private Integer restrictTotal;
    /**
     * 每单限购数量(0为不限制)
     */
    private Integer restrictSingle;
    /**
     * 是否单独设置配送方式(0关闭 1开启)
     */
    private Integer isIndDeliveryType;
    /**
     * 商品配送方式(仅单独设置时有效)
     */
    @ApiModelProperty(value = "商品发货方式")
    private Object deliveryType;
    // private List<Integer> deliveryType;


    @ApiModelProperty(value = "商品图片列表")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<YunscUploadFileEntity> goodsImages;

    @ApiModelProperty(value = "商品服务列表")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Integer goodsSales;



    @JsonProperty("skuList")
    @ApiModelProperty(value = "商品规格列表")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<GoodsSkuDTO> skuList;

    @JsonProperty("specList")
    @ApiModelProperty(value = "商品标签id列表")
    private List specList;

    @ApiModelProperty(value = "商品视频")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private YunscUploadFileEntity video;

    @JsonProperty("videoCover")
    @ApiModelProperty(value = "商品视频封面")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private YunscUploadFileEntity videoCover;
}
